package com.rhyton.component.upload.domain;

import java.io.File;
import java.util.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.rhyton.common.dao.annotation.PrimaryKey;

/**
 * @author Zhangxin
 */
public class AttactFile {
    private Long id; // 全局唯一标识ID

    private String bizCode;

    private Long bizId;
    
    private String contentType; //文件类型

    private String name; //文件名称

    private File file; // 实际文件
    
    private Date createdTime;

    private String storePath; // the stored path of the file;

    public String getBizCode() {
	return bizCode;
    }

    public void setBizCode(String bizCode) {
	this.bizCode = bizCode;
    }

    public Long getBizId() {
	return bizId;
    }

    public void setBizId(Long bizId) {
	this.bizId = bizId;
    }

    public AttactFile() {
    }

    public AttactFile(String contentType, String name, File file) {
	this(null, contentType, name, file);
    }

    public AttactFile(Long id, String contentType, String name) {
	this(id, contentType, name, null);
    }

    public AttactFile(Long id, String contentType, String name, File file) {
	this.id = id;
	this.contentType = contentType;
	this.name = name;
	this.file = file;
    }

    @PrimaryKey
    public Long getId() {
	return id;
    }

    @PrimaryKey
    public void setId(Long id) {
	this.id = id;
    }

    /**
     * the file content type<br>
     * <mime-mapping><br>
     * &nbsp;&nbsp;<extension>xls</extension><br>
     * &nbsp;&nbsp;<mime-type>application/vnd.ms-excel</mime-type><br>
     * </mime-mapping><br>
     * <mime-mapping><br>
     * &nbsp;&nbsp;<extension>doc</extension><br>
     * &nbsp;&nbsp;<mime-type>application/msword</mime-type><br>
     * </mime-mapping><br>
     * 
     * @return
     */
    public String getContentType() {
	return contentType;
    }

    public void setContentType(String contentType) {
	this.contentType = contentType;
    }

    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }

    public File getFile() {
	return file;
    }

    public void setFile(File file) {
	this.file = file;
    }

    public String getStorePath() {
	return storePath;
    }

    public void setStorePath(String storePath) {
	this.storePath = storePath;
    }

    public String toString() {
	ToStringBuilder tsb = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE);
	tsb.append("id", id);
	tsb.append("name", name);
	tsb.append("contentType", contentType);
	tsb.append("storePath", storePath);
	return tsb.toString();
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }
 

}
